gam=4258; twopi=2*pi;
gmx=3.62; fov=12.8;
nres=128; Ta=0.06;

kf=nres/(2*fov);
delt=1./(gam*gmx*fov);
Na=floor(Ta/delt);
tim=(0:Na-1)*delt;
om1=gam*gmx/kf;
Nro=37;
om2=(Nro/nres)*om1;
kss=kf*cos(om1*tim).*exp(1i*om2*tim);
plot(kss(1,:));title('Rosette Trajectory');
kx1=real(kss)';
ky1=imag(kss)';
save ktraj kx1 ky1;
%clear all;

% kr=sqrt(kx.^2+ky.^2);
% 
% R=2.5;R20=32;y0=0.75;
% Rout=4;Rout2=2.5;

% X12=besselj(1,pi*Rout.*kr);
% x1=(Rout^2.*X12./(pi*Rout.*kr));
% 
% x2=exp(-R20.*tim);
% 
% coex=-2i*pi;
% x3=exp(coex*(-ky*y0+100*tim));
% 
% FID2=0.5*x1.*x2.*x3;
% 
% FID2= FID2-0.5*(Rout2^2.*besselj(1,pi*Rout2.*kr)./(pi*Rout2.*kr)).*exp(-R20.*tim).*exp(coex*(-ky*y0+100*tim));
% 
% FID2= FID2+(Rout2^2.*besselj(1,pi*Rout2.*kr)./(pi*Rout2.*kr)).*exp(-R20.*tim).*exp(coex*(-ky*y0-100*tim));
% 
% plot(FID2(1,:));